home *** CD-ROM | disk | FTP | other *** search
Wise script | 1999-04-26 | 3.8 KB | 178 lines |
- Document Type: WSE
- item: Global
- Version=6.0
- Title=Application kill.
- Flags=00000100
- Split=1420
- Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- Japanese Font Name=MS Gothic
- Japanese Font Size=10
- Start Gradient=0 0 255
- End Gradient=0 0 0
- Windows Flags=00000100000000000010110000001000
- Message Font=MS Sans Serif
- Font Size=8
- Disk Filename=SETUP
- Patch Flags=0000000000000001
- Patch Threshold=85
- Patch Memory=4000
- FTP Cluster Size=20
- end
- item: Remark
- end
- item: Remark
- Text=This script will detect if MS Word is running and ask if you would like to terminate it.
- end
- item: Remark
- end
- item: Remark
- Text=Set FINDAPP to the Applicaiton you wish to terminate
- end
- item: Set Variable
- Variable=FINDAPP
- Value=Microsoft Word
- end
- item: Remark
- end
- item: Remark
- Text=The following variables should not be modified.
- end
- item: Remark
- Text=They are the maximum preallocated space in a variable for a Title and Class
- end
- item: Set Variable
- Variable=LEN
- Value=250
- end
- item: Set Variable
- Variable=CLASSLEN
- Value=250
- end
- item: Remark
- Text=First find the Desktop Window Handle
- end
- item: Call DLL Function
- Pathname=%SYS%\USER32.DLL
- Function Name=GetDesktopWindow
- Return Variable=3DESKTOPWIN
- Flags=00100000
- end
- item: Remark
- Text=Then get the first Window Handle based on the Z order
- end
- item: Call DLL Function
- Pathname=%SYS%\USER32.DLL
- Function Name=GetWindow
- Argument List=30DESKTOPWIN
- Argument List=215
- Return Variable=3FIRSTWIN
- Flags=00100000
- end
- item: If/While Statement
- Variable=FIRSTWIN
- Value=0
- Flags=00010001
- end
- item: Remark
- Text=Get the class name and window title for this window
- end
- item: Remark
- Text=The Class name is not needed for this example
- end
- item: Call DLL Function
- Pathname=%SYS%\USER32.DLL
- Function Name=GetClassNameA
- Argument List=30FIRSTWIN
- Argument List=40WINCLASS
- Argument List=20LEN
- Return Variable=2RETURNCLASS
- Flags=00100000
- end
- item: Call DLL Function
- Pathname=%SYS%\USER32.DLL
- Function Name=GetWindowTextA
- Argument List=30FIRSTWIN
- Argument List=40WINTITLE
- Argument List=20LEN
- Return Variable=2RETURNVAL
- Flags=00100000
- end
- item: If/While Statement
- Variable=WINTITLE
- Flags=00000001
- end
- item: Remark
- Text=Uncomment this message to see all the Windows with titles
- end
- remarked item: Display Message
- Title=Application Window Title
- Text=%WINTITLE%
- end
- item: End Block
- end
- item: If/While Statement
- Variable=WINTITLE
- Value=%FINDAPP%
- Flags=00000010
- end
- item: Display Message
- Title=Application is Active
- Text=The %FINDAPP% Application is active.
- Text=
- Text=Would you like to terminate it?
- Flags=00000001
- end
- item: Remark
- Text=Send WM_CANCELMODE to drop any modal dialogs
- end
- item: Call DLL Function
- Pathname=%SYS%\USER32.DLL
- Function Name=PostMessageA
- Argument List=30FIRSTWIN
- Argument List=3131
- Argument List=310
- Argument List=310
- Return Variable=0RETURNVAL
- Flags=00100000
- end
- item: Remark
- Text=Send WM_CLOSE to have the application exit
- end
- item: Call DLL Function
- Pathname=%SYS%\USER32.DLL
- Function Name=PostMessageA
- Argument List=30FIRSTWIN
- Argument List=3116
- Argument List=310
- Argument List=310
- Return Variable=0RETURNVAL
- Flags=00100000
- end
- item: Remark
- Text=Bring the window to the foreground if it is still there.
- end
- item: Remark
- Text=It could be that it is waiting for input.
- end
- item: Call DLL Function
- Pathname=%SYS%\USER32.DLL
- Function Name=SetForegroundWindow
- Argument List=30FIRSTWIN
- Return Variable=0
- Flags=00100000
- end
- item: End Block
- end
- item: End Block
- end
- item: Call DLL Function
- Pathname=%SYS%\USER32.DLL
- Function Name=GetWindow
- Argument List=30FIRSTWIN
- Argument List=212
- Return Variable=3FIRSTWIN
- Flags=00100000
- end
- item: End Block
- end
-